package com.zhkj.framework.service.impl;

import com.zhkj.framework.domain.Experience;
import com.zhkj.framework.domain.Person;
import com.zhkj.framework.mapper.ExperienceMapper;
import com.zhkj.framework.mapper.PersonMapper;
import com.zhkj.framework.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Auther: zhangy
 * @Date: 2018/10/30 10:17
 * @Description:
 */
@Service
public class PersonServiceImpl implements PersonService {

    @Autowired
    private PersonMapper personMapper;

    @Autowired
    private ExperienceMapper experienceMapper;

    @Override
    public Person findOne(Integer personid) {
        Person person = personMapper.selectByPrimaryKey(personid);
        List<Experience> experienceList = experienceMapper.findExperienceByPersonId(personid);
        person.setExperienceList(experienceList);

        return person;
    }
}
